import { request } from "@/request";

//新增物资
export const addMaterial = (params: any) =>
  request({
    method: "POST",
    url: "/material/addMaterial",
    data: params,
  });
//修改物资
export const updateMaterial = (params: any) =>
  request({
    method: "POST",
    url: "/material/updateMaterial",
    data: params,
  });
//删除物资
export const deleteMaterial= (ids: string[]) =>
  request({
    method: "DELETE",
    url: `/material/delMaterial/${ids}`,
  });

//物资列表
export const getMaterialList = (params: any) =>
  request({
    method: "POST",
    url: `/material/pageQuery`,
    data: {
      pageCurrent: 1,
      pageSize: 1000,
      ...(params || {}),
    },
  });

//物资详情
export const getMaterialDetail = (id: string) =>
  request({
    method: "GET",
    url: `/material/getInfo/${id}`,
  });

//物资分类列表
export const getMaterialTypeList = () =>
  request({
    method: "POST",
    url: `/materialClassification/all`,
  });
